<!doctype html>
<html class="no-js">

<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>干部任免审批表</title>
	<meta name="description" content="">
	<meta name="keywords" content="">
	<script type="text/javascript">
		var phoneScale = parseInt(window.screen.width) / 1000;
		document.write('<meta name="viewport" content="width=device-width,initial-scale=1 minimum-scale = 1, maximum-scale = 3, user-scalable=yes">')
	</script>
	<!--[if (gte IE 9)|!(IE)]><!-->
	<script src="js/jquery.min.js"></script>
	<!--<![endif]-->
	<script src="js/amazeui.min.js"></script>
	<script type="text/javascript" src="./skins/js/jquery-1.4.4.min.js"></script>
	<script type="text/javascript" src="./skins/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src="./skins/js/jcarousellite_1.0.1.min.js"></script>
	<script type="text/javascript" src="./skins/js/slide_change.js"></script>
	<script type="text/javascript" src="./script/doT.min.js"></script>

	<script type="text/javascript" src="./script/api.js"></script>
	<!-- css -->
	<link rel="stylesheet" href="css/amazeui.min.css">
	<link rel="stylesheet" href="css/app.css">
	<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
	<!-- <link href="./css/style.css" rel="stylesheet" type="text/css" /> -->
	<link rel="stylesheet" href="css/style.css">

</head>

<body>
	<!-- <div class="jianli-t"><div class="jianli-t-s"><span class="fa fa-caret-left" onclick="api.closeWin()"></span>返回</div></div> -->
	<h2 class="gbrm-t">干部任免审批表</h2>
	<div style="padding:0 5px;">
		<table class="gbrm" cellspacing="0" cellpadding="0" align="center">
			<h2></h2>
			<tr>
				<td width="11%">姓&nbsp;&nbsp;&nbsp;名</td>
				<td width="13%" id='I01'>XXX</td>
				<td width="11%">性别</td>
				<td width="14%" id='I02'>男</td>
				<td width="12.5">出生年月
					<p>(岁)</p>
				</td>
				<td width="13%" id='I03'>1958.12
					<p>(59岁)</p>
				</td>
				<td width="24.46%" rowspan="4" style="padding:0;"><img id="img" src="file:///storage/emulated/0/ader/pic/{{=value.ID}}.jpg" /></td>
			</tr>
			<tr>
				<td>民&nbsp;&nbsp;&nbsp;族</td>
				<td id='I04'>汉族</td>
				<td>籍&nbsp;&nbsp;&nbsp;贯</td>
				<td id='I05'>湖南
					<p>汉寿</p>
				</td>
				<td>出&nbsp;&nbsp;生&nbsp;&nbsp;地</td>
				<td id='I06'>黑龙江
					<p>佳木斯</p>
				</td>
			</tr>
			<tr>
				<td>入&nbsp;&nbsp;&nbsp;党
					<p>时&nbsp;&nbsp;&nbsp;间</p></td>
				<td id='I07'>1989.06</td>
				<td>参加工
					<p>作时间</p>
				</td>
				<td id='I08'>1977.08</td>
				<td>健康状况</td>
				<td id='I09'>健康</td>
			</tr>
			<tr>
				<td>专业技
					<p>术职务</p>
				</td>
				<td colspan="2" id='I10'></td>
				<td>熟悉专业
					<p>有何特长</p>
				</td>
				<td colspan="2" id='I11'></td>
			</tr>
			<tr>
				<td rowspan="2">学&nbsp;&nbsp;&nbsp;历
					<p>学&nbsp;&nbsp;&nbsp;位</p>
				</td>
				<td>全日制
					<p>教&nbsp;&nbsp;&nbsp;育</p>
				</td>
				<td colspan="2" id='I12'>中专</td>
				<td>毕业院校
					<p>系及专业</p>
				</td>
				<td colspan="2" id='I13' style="text-align:left;">湘潭机电专科学校物资管理专业</td>
			</tr>
			<tr>
				<td>在&nbsp;&nbsp;&nbsp;职
					<p>教&nbsp;&nbsp;&nbsp;育</p>
				</td>
				<td colspan="2" id='I14'>大专
					<p>农业推广硕士</p>
				</td>
				<td>毕业院校
					<p>系及专业</p>
				</td>
				<td colspan="2" id='I15' style="text-align:left;">黑龙江商学院统计专业
					<p>东北林业大学农业与区域发展</p>
				</td>
			</tr>
			<tr>
				<td colspan="2">现&nbsp;&nbsp;&nbsp;任&nbsp;&nbsp;&nbsp;职&nbsp;&nbsp;&nbsp;务</td>
				<td colspan="5" id='I16' style="text-align:left;"></td>
			</tr>
			<tr>
				<td colspan="2">拟&nbsp;&nbsp;&nbsp;任&nbsp;&nbsp;&nbsp;职&nbsp;&nbsp;&nbsp;务</td>
				<td colspan="5" id='I17' style="text-align:left;"></td>
			</tr>
			<tr>
				<td colspan="2">任&nbsp;&nbsp;&nbsp;免&nbsp;&nbsp;&nbsp;职&nbsp;&nbsp;&nbsp;务</td>
				<td colspan="5" id='I18' style="text-align:left;"></td>
			</tr>

			<!-- <script type='text/template' id='templateTwo'> -->

			<tr>

				<td>简
					<p style="padding-top:30px">历</p>
				</td>
				<td colspan="6" style="text-align:left; padding-left: 0px; padding-right: 0px; padding-bottom: 0px;" valign="top">
					<div id="two">
					</div>
					<script type='text/template' id='templateTwo'>
					<table style="width: 100%;height: 100%;border-style: none;text-align:left;">
							{{~it :value:index}}
									<tr style="height:10px;">
										<td style="width: 146px;text-align:left;vertical-align:top; border-style: none;height:auto;">
											<span styel="line-height:1px;">{{=value.Intro0}}
											</span>
										</td>
										<td style="border-right:0px;text-align:left;vertical-align:top; border-style: none;height:auto;">
											<span styel="line-height:1px;">{{=value.Intro1}}
											</span>
										</td>
									</tr>

	{{~}}
	<!-- <div style="width:100%; height100%;">
		<ul style="width:100%;">
			{{~it :value:index}}
			<li style="float:left; width:100%"><div style="float:left;width:145px;">{{=value.Intro0}}</div><div>{{=value.Intro1}}</div></li>
				{{~}}
		</ul>

	</div> -->
								</table>
									</script>
				</td>
			</tr>


			<!-- <script type='text/template' id='templateTwo'>
				<tbody>
					{{~it :value:index}}
					<p>{{=value.Intro}}</p>
					{{~}}
				</tbody>
			</script> -->
			<!-- </script> -->


			<!-- <tr> -->
			<td style="height:160px; padding:5px 0;">奖<br>励<br>情<br>况</td>
			<td colspan="6" style="text-align:left;" id='I19'></td>
			</tr>
			<tr>
				<td style="height:100px;">年度
					<p>考核</p>
					<p>结果</p>
				</td>
				<td colspan="6" style="text-align:left;" id='I20'></td>
			</tr>
			<tr>
				<td style="height:100px; padding:5px 0;">任<br>免<br>理<br>由</td>
				<td colspan="6" style="text-align:left;" id='I21'></td>
			</tr>
		</table>
		<div id="list">
		</div>
		<script type='text/template' id='template'>
			<table class="gbrm" cellspacing="0" cellpadding="0" align="center" style="border-top:0;">
				<tr>
					<td rowspan="11" style="width:11%; padding:5px 0;">主<br>要<br>家<br>庭<br>成<br>员<br>及<br>重<br>要<br>社<br>会<br>关<br>系</td>
					<td style="width:10%">称谓</td>
					<td style="width:10%">姓名</td>
					<td style="width:13%">出生年月</td>
					<td style="width:13%">政治面貌</td>
					<td colspan="2">工作单位及职务</td>
				</tr>
				{{~it :value:index}}
				<tr>
					<td>{{=value.a}}</td>
					<td>{{=value.b}}</td>
					<td>{{=value.c}}</td>
					<td>{{=value.d}}</td>
					<td style="text-align:left;">{{=value.e}}</td>
				</tr>
				{{~}}
			</table>
		</script>
		<table class="gbrm" cellspacing="0" cellpadding="0" align="center" style="border-top:0">
			<tr>
				<td style="width:11%; height:100px; padding:5px 0;">呈<br>报<br>单<br>位</td>
				<td colspan="6" style="text-align:left;">

					<div class="gbrm-s">
						(盖&nbsp;&nbsp;&nbsp;章)
						<p>
							年<span></span>月<span></span>日
						</p>
					</div>
				</td>
			</tr>
			<tr>
				<td style="width:11%; height:100px;">审批<br>机关<br>意见</td>
				<td>

					<div class="gbrm-s">
						(盖&nbsp;&nbsp;&nbsp;章)
						<p>
							年<span></span>月<span></span>日
						</p>
					</div>
				</td>
				<td style="width:11%; height:100px;">行政<br>机关<br>任免<br>意见</td>
				<td>

					<div class="gbrm-s">
						(盖&nbsp;&nbsp;&nbsp;章)
						<p>
							年<span></span>月<span></span>日
						</p>
					</div>
				</td>
			</tr>
		</table>
		<div class="gbrm-d">填表人：</div>
	</div>

</body>

</html>

<script type="text/javascript">
	apiready = function() {
		//on b.Ldr_ID = a.ID ORDER BY ID
		var id = api.pageParam.id;
		var db = api.require('CPDB');
		var sql = 'SELECT * FROM base_info,base_family WHERE base_info.id =' + id + ' AND base_info.ID = base_family.PID';
		// var sql = 'SELECT a.ID ,a.I01,a.I02,a.I03,a.I04,a.I05,a.I06,a.I07,a.I08,a.I09,a.I10,a.I11,a.I12,a.I13,a.I14,a.I15,a.I16,a.I17,a.I18,a.I19,a.I20,a.I21,a.I22,a.I23,a.I24,a.I25,a.I26,b.a,b.b,b.c,b.d,b.e,b.isort FROM base_info as a,base_family as b WHERE a.id =' + id + ' AND a.ID = b.PID';
		db.selectSql({
			name: 'data',
			sql: sql
		}, function(ret, err) {
			if (ret.status) {
				var dataPage = ret.data;
				for (var i = 1; i < 22; i++) {
					if (i < 10) {
						var t = 'I0' + i;
						var temp = dataPage[0][t];
						temp = temp.replace(/[\r\n]/g, "<p>");
						temp = temp + '</p>';
						if (i == 3) {
							temp = temp.substring(0, 7);
							temp = temp.replace(/-/g, ".");
							var date = new Date(temp);
							var age = new Date().getFullYear() - date.getFullYear();
							age= age-1;

						// 	var age = Math.ceil(newDate / 1000 / 60 / 60 / 24 /365) -1;
						// new Date()
			var dangqian = new Date().getMonth() + 1;
			var shuju  = date.getMonth() + 1;

			if (dangqian >=  shuju) {
    		 age = age + 1;
			}
							temp = temp + ' <br> (' + age + ' 岁) ';
						}

						$("#I0" + i).html(temp);
					} else {
						var t = 'I' + i;
						var temp = dataPage[0][t].replace(/[\r\n]/g, "<p>");
						temp = temp.replace(/\\r/g, "</p>");
						$("#I" + i).html(temp);
					}
				}
				var tempImg = ret.data[0].PID;
				var src = 'file:///storage/emulated/0/ader/java/' + tempImg + '.jv'

				$("img").attr("src", src);
				var dotFn = doT.template(template.innerHTML);
				var html = dotFn(ret.data);
				var list = $api.byId('list');
				$api.html(list, html);

				//
				var sql = 'SELECT * FROM base_briefIntro where pid =' + id;
				db.selectSql({
					name: 'data',
					sql: sql
				}, function(ret, err) {
					if (ret.status) {
						var jlData = ret.data;
						var twData= new Array;
						var dotFn = doT.template(templateTwo.innerHTML);
						// alert(JSON.stringify(ret.data));
						// temp.replace(/[\r\n]/g, "<p>");
						for (var i = 0; i < jlData.length; i++) {
							if (jlData[i].Intro.indexOf('   ') >0) {
							jlData[i].Intro = jlData[i].Intro.replace(/        /g, "　　　&nbsp&nbsp&nbsp");
							}
							if (jlData[i].Intro.length > 0) {
								jlData[i].Intro =  '&nbsp&nbsp'+jlData[i].Intro;
							}
							if (jlData[i].Intro1 !='') {
								twData[i] = jlData[i];
							}
						}





						var html = dotFn(twData);
						var list = $api.byId('two');
						$api.html(list, html);
						api.hideProgress();
					} else {
						alert(JSON.stringify(err));
					}
				});
			} else {
				alert(JSON.stringify(err));
			}
		});


		api.execScript({
			name: 'index',
			script: 'closePrgress();'
		});

	}
</script>
